import Vue from 'vue'
import axios from 'axios'
Vue.use(axios);
const BASEURL="http://139.224.220.33:8868";

var reqURL={
  baseUrl:BASEURL,
  registUrl:BASEURL + '/Api/Register/addUser',
  getMobileCode:BASEURL + '/Api/Register/sendMobileCode',
  loginUrl:BASEURL + '/Api/Login/login',
  userInfomation:BASEURL + '/api/UserInfo/information',
  addressList:BASEURL + '/api/UserInfo/addressList',//请求用户地址
  getSaveInformation:BASEURL+'/api/UserInfo/saveInformation',//修改个人信息
  addUserAddress:BASEURL + '/api/UserInfo/addUserAddress',//添加用户地址
  delUserAddress:BASEURL + '/api/UserInfo/delUserAddress',//删除地址
  setUserAddress:BASEURL + '/api/UserInfo/setUserAddress',//设置用户默认地址
  myMessage: BASEURL + '/api/UserInfo/myMessage',//我的消息
  orderInfo: BASEURL + '/api/Shop/orderInfo',//订单详情  takePro: BASEURL + '/api/Shop/takePro',//用户确认收货
  messageInfo: BASEURL + '/api/UserInfo/messageInfo',//信息标记为已读
  msgrefuse: BASEURL + '/api/UserInfo/msgrefuse',//添加回复信息
  addProExchange: BASEURL + '/api/UserInfo/addProExchange',//添加二手商品
  delProExchange: BASEURL + '/api/UserInfo/delProExchange',//删除二手商品
  myProExchange: BASEURL + '/api/UserInfo/myProExchange',//我的二手商品
  subComment:BASEURL + '/api/Shop/subComment',//用户提交评价
  refundSub:BASEURL + '/api/Shop/refundSub',//用户退货
  refundPro: BASEURL + '/api/Shop/refundPro',//用户退货原因列列表
  updateUserAddress:BASEURL + '/api/UserInfo/updateUserAddress',//修改地址
  changeMobile:BASEURL + '/api/UserInfo/changeMobile',//更换绑定手机
  getChangePassword:BASEURL + '/api/UserInfo/changePassword',//修改密码
  getProvinceList:BASEURL + '/api/UserInfo/getProvince',
  // resetPassword:BASEURL + '/Api/userInfo/resetPassword',//重置密码
  resetPassword: BASEURL + '/Api/UserInfo/forgetPassword',
  cancel: BASEURL + '/api/Shop/cancel',//用户取消发货
  homeBabyKnowlge:BASEURL + '/api/Index/getBabyNow',//首页育儿知识
  myGroups:BASEURL + '/api/Circle/myFocusCircle',//我的圈子
  myCreateCircle: BASEURL + '/Api/Circle/myCreateCircle', //我创建的圈子
  createCircle: BASEURL + '/api/Circle/createCircle',
  circleLableList: BASEURL + '/Api/Circle/circleLableList',//获取圈子的tag
  tuijianGroups:BASEURL + '/api/Circle/recommendCircle',//热门圈子
  getHotCircle:BASEURL + '/api/Circle/hotCircle',//获取热门圈子
  boutiqueCircle:BASEURL + '/api/Circle/rqCircle',//获取精选圈子
  socialFocusList:BASEURL + '/api/Index/getCircleFocus',//获取社会焦点列表
  getNoteList:BASEURL + '/api/CircleNote/noteList',//获取帖子列表
  getBabyKnowlogeList:BASEURL + '/api/BabyKnow/index',//育儿知识列表
  getBabyActive:BASEURL + '/api/Index/getActive',
  getActive:BASEURL + '/api/CircleNote/activity',//获取活动内容
  delFocusCircle: BASEURL + '/api/Circle/delFocusCircle',
  followCircle:BASEURL + '/api/Circle/setFocusCircle',//关注圈子
  babyKnowlogeTagList:BASEURL + '/api/BabyKnow/age_list',//育儿知识标签
  babyKnowlgeDetail:BASEURL + '/api/BabyKnow/know_detail',//育儿知识详情
  babyKnowledgeComment:BASEURL + '/api/BabyKnow/KnowledgeComment',//获取育儿知识评论


  /**免费课程、畅销课程、课程评论,提交评论*/
  getCourseList:BASEURL + '/Api/Course/freeAdmission',
  courseDetail:BASEURL + '/Api/Course/lessonDetail',
  getCourseEvaluate:BASEURL + '/Api/Course/getComment',
  commitCourseEvaluate:BASEURL + '/Api/Course/pinglun',
  courseTag:BASEURL + '/api/Course/courseTag',//课程标签
  buyCourse:BASEURL + '/api/Course/buyLesson',//购买课程
  commitZiXun:BASEURL + '/api/Course/addZiXun',//添加课程咨询



  /** 专题推荐*/
  getSpecialRecommendation:BASEURL + '/api/Course/specialRecommendation',

  /** 集市*/
  commodityWithScore:BASEURL + '/api/Shop/good',//积分兑换
  commodityWithCommodity:BASEURL + '/api/Shop/exChange',//与物换物
  commodityWithAuction:BASEURL + '/api/Shop/auction',//拍卖列表
  fairShopDetail:BASEURL + '/api/Shop/shopDetail',//拍卖详情
  scoreShopDetail:BASEURL + '/api/Shop/shopPro',//积分兑换商品详情
  exchangeShopDetail:BASEURL + '/api/Shop/exchangeInfo',//以物换物详情
  fairAddCart:BASEURL + '/api/Shop/GoodsCart',
  FaircartInfo:BASEURL + '/api/Shop/cartInfo',//购物车
  createOrder:BASEURL + '/api/Shop/createOrder',//提交积分兑换订单
  homeRecommendedArticles:BASEURL + '/api/Index/RecommendedArticles',//推荐文章
  noteDetail:BASEURL + '/api/CircleNote/noteDetail',//文章、帖子详情
  addNoteComment:BASEURL + '/api/CircleNote/addNoteComment',//添加文章，帖子的评论
  addBabyKonwComment:BASEURL + '/api/BabyKnow/addComment',//评论、回复育儿知识评论
  createNewNote:BASEURL + '/api/CircleNote/addNote',//发表帖子
  collectShop:BASEURL + '/api/Shop/collectShop',//我收藏的商品
  delCollectGoods:BASEURL + '/api/Shop/delCollectGoods',//取消收藏
  setCollectGoods:BASEURL + '/api/Shop/setCollectGoods',//添加收藏
  removeCart:BASEURL + '/api/Shop/removeCart',//移除购物车
  checkOrder:BASEURL + '/api/Shop/checkOrder',//订单详情
  groupBanner:BASEURL + '/api/Shop/index',//集市banner
  fairLabelList: BASEURL + '/api/Shop/labelList',






  /**************************专家相关********************************/
  profes_Tag_list:BASEURL + '/api/Expert/expertLabelList',
  profes_list:BASEURL + '/api/Expert/index',
  createQuestion:BASEURL + '/api/Expert/createQuestion',//创建咨询
  /*图片上传*/
  getImgUp:BASEURL+'/api/BabyInfo/uploadFile',//图片上传

  /*日记*/
  getMeDiary:BASEURL + '/api/BabyInfo/myTimeLine',//我的成长日记
  submitMeDiary:BASEURL + '/api/BabyInfo/myTimeLineCreate',//提交我的日记

  /*宝宝*/
  getBabyRanking:BASEURL+'/api/UserInfo/getBabyRank',//宝宝排名
  getMyBady:BASEURL + '/api/BabyInfo/myBaby',//我的宝宝
  getAddBady:BASEURL + '/api/BabyInfo/addBaby',//添加宝宝
  babyInfo:BASEURL + '/Api/BabyInfo/babyInfo',//获取宝宝信息
  getBabyGrowthDetails:BASEURL + '/api/BabyInfo/myTimeLineDetail',//宝宝日记详情
  delBaby:BASEURL + '/api/BabyInfo/delBaby',//删除宝宝
  buyProExchange: BASEURL + '/api/UserInfo/buyProExchange',


  /*评测*/
  getTest:BASEURL + '/api/Test/index',//评测首页
  getEvaPast:BASEURL+'/api/Test/levelInfo',//往期报告
  getEvaStart:BASEURL+'/api/Test/protest',//开始评测
  getSubmit:BASEURL+'/api/Test/submitTest',//提交评测
  getReports:BASEURL+'/api/Test/reports',//评测报告
  getViewReport:BASEURL+'/api/Test/view_report',//查看报告

  getIsTest:BASEURL+'/api/Test/isTest',//检测评测次数
  getBuyTestNow:BASEURL+'/api/Test/buyTestNow',//购买评测
  getHotLesson:BASEURL+'/api/Test/hotLesson',//课程推荐


  /*点评*/
  getComment:BASEURL + '/api/Market/index',//点评首页
  getCommentList:BASEURL+'/api/Market/commentList',//获取评论
  getMarketInfo:BASEURL+'/api/Market/marketInfo',//点评详情
  getMarketList:BASEURL+'/api/Market/marketList',//点评列表
  getCreateComment:BASEURL+'/api/Market/createComment',//创建点评

  multimediaHome:BASEURL + '/api/Audio/index',//视听课首页
  multimediaDetails:BASEURL + '/api/Audio/lesson_study',
  buyAudio:BASEURL + '/api/Audio/buyAudio',
  getAudioLabel:BASEURL + '/api/Audio/getAudioLabel',
  multimediaList:BASEURL + '/api/Audio/more',
  myOrder:BASEURL + '/api/Shop/order',
  setProExchange:BASEURL + '/api/Shop/setProExchange',


  getAliPayCode:BASEURL + '/api/Api/getAliPayCode' ,//支付宝预下单
  getWeiXinPayCode:BASEURL + '/api/Api/getWeiXinPayCode', // 微信预下单
  payAjax:BASEURL + '/api/Api/payAjax', // 微信支付检测支付状态


}




function req_post(netapi,bodyData,callback) {
  const registerUrl=reqURL[netapi];
  const newUserInfo=bodyData;
  axios.post(registerUrl, newUserInfo, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
    .then(function (response) {
      let getData=response['data'];
         callback(getData)
    })
    .catch(function (error) {
      console.log(error);
    });

}

export {req_post}
